package com.trade.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.trade.model.Test;
import com.trade.service.ITestService;

public class TestAction extends DispatchAction {

	private ITestService testService;
		
	public ITestService getTestService() {
		return testService;
	}

	public void setTestService(ITestService itemService) {
		this.testService = itemService;
	}

	public ActionForward test(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response){
		Long id = 1l;
		Test test = this.testService.getTest(id);
		request.setAttribute("test", test);
		return mapping.findForward("test");		
	}
}
